home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
RCSC.ZIP
/
LIB51
/
ITOA.C
< prev
next >
Wrap
C/C++ Source or Header
|
1997-01-12
|
292b
|
17 lines
/*
** itoa(n,s) - Convert n to characters in s
*/
itoa(n, s) char *s; int n; {
int sign;
char *ptr;
ptr = s;
if ((sign = n) < 0) n = -n;
do {
*ptr++ = n % 10 + '0';
} while ((n = n / 10) > 0);
if (sign < 0) *ptr++ = '-';
*ptr = '\0';
reverse(s);
}